Index
Declaring Ivars Gotcha 🐞


class Rectangle {

	//Ivars
	_width;
	_height;

	//Constructors
	constructor(w, h) {
		super();
		this._width.setValue(w);
		this._height.setValue(h);
	}

	initVars() {
		this.width = SimpleVar.fromName('width');
		this.height = SimpleVar.fromName('height');
	}
	
}
This is the recommended approach -- List the ivars as comments. That way, the previous gotcha will not occur.
class Rectangle {

	//Ivars
	//width;
	//height;

	//Constructors
	constructor(w, h) {
		this.width = w;
		this.h = h;
	}
	
}